﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登录</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery.form/4.2.0/jquery.form.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#form").submit(function () {
                $("#login").button('loading');
            });
            $("#form").ajaxForm(function (message) {
                if (message.returnCode == "001") {
                    $("#login").button('loading').button('reset');
                    location.href = "/Position/GetPositionList";
                }
                else if (message.returnCode == "999") {
                    alert("登录失败！邮箱或密码错误");
                    $("#login").button('loading').button('reset');
                }
            });
        });
    </script>
    <style>
        .demo {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 400px;
            height: 500px;
            margin-top: -150px;
            margin-left: -200px;
            display: block;
        }
    </style>
</head>
<body style="background-image:url(/background-image/login-bg-autumn.jpg)">
    <div class="demo">
        <form class="form-horizontal" action="/Applicant/Login" method="post" id="form">
            <div class="form-group">
                <img src="~/background-image/hzu_logo.png" />
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">邮箱</label>
                <div class="col-sm-10">
                    <input type="email" class="form-control" name="email" placeholder="请输入邮箱..." required autofocus />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" name="password" placeholder="请输入密码..." required />
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" id="login" class="btn btn-default btn-info btn-block" data-loading-text="登录中...">登录</button>
                    <a href="/Applicant/Register" class="btn btn-default btn-warning btn-block">注册</a>
                </div>
            </div>
        </form>
    </div>
</body>
</html>